package demo4.controller;

import demo4.mapper.IUserMapper;
import demo4.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Scanner;

@Component
public class UserController {
    @Autowired
    private IUserMapper userMapper;
    public void start(){
        System.out.println("请输入对应操作序号：");
        System.out.println("1.登录,2.注册,3.退出");
        Scanner sc=new Scanner(System.in);
        int num=Integer.parseInt(sc.nextLine());
        switch (num){
            case 1:
                loginUser();
                break;
            case 2:
                regUser();
                break;
            case 3:
                System.exit(0);
                break;
            default:
                System.out.println("其他功能还在完善");
        }
    }
    public void regUser(){
        System.out.println("开始处理用户注册");
        userMapper.insert(null);
    }
    public void loginUser(){
        System.out.println("开始处理用户登录");
    }
}
